package net.bwie.jtp.service.mapper;

import net.bwie.jtp.service.bean.DwsLogPageViewWindowReport;
import net.bwie.jtp.service.bean.TrafficPvReport;
import net.bwie.jtp.service.bean.TrafficUvReport;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author: FuHe
 * @Date: 2025/5/21
 */
@Mapper
public interface TrafficChannelStatsMapper {

    // 获取各渠道独立访客数
    @Select("select " +
            "channel," +
            "sum(uv_count) as uv_count " +
            "from jtp_log_report.dws_log_page_view_window_report " +
            "where toDate(window_start_time) = #{date} " +
            "group by channel")
    List<TrafficUvReport> selectUvCount(@Param("date") String date);
    @Select("select " +
            "channel," +
            "sum(pv_count) as pv_count " +
            "from jtp_log_report.dws_log_page_view_window_report " +
            "where toDate(window_start_time) = #{date} " +
            "group by channel")
    List<TrafficPvReport> selectPvCount(String date);

    @Select("select " +
            "* " +
            "from jtp_log_report.dws_log_page_view_window_report " +
            "where toDate(window_start_time) = #{date}")
    List<DwsLogPageViewWindowReport> selectPageAll(String date);
}
